<template>
  <div style="padding:30px;">
    <div style="display: flex;flex-wrap:wrap;margin-top:20px;float:right;margin-right:20px;">
      <el-button type="danger" icon="el-icon-delete">删除文件</el-button>
      <el-button type="primary" icon="el-icon-upload">下载文件</el-button>
    </div>
    <div style="margin-top:20px;margin-right:20px;margin-left:20px;">
      <el-table
        :data="tableData"
        border
        style="width: 100% ;top: 25px">
        <el-table-column
          type="selection"
          width="55">
        </el-table-column>
        <el-table-column
          fixed
          prop="id"
          label="序号"
          width="150">
        </el-table-column>
        <el-table-column
          prop="file_name"
          label="文件名"
          width="220">
        </el-table-column>
        <el-table-column
          prop="date"
          label="创建时间"
          width="220">
        </el-table-column>
        <el-table-column
          prop="state"
          label="状态"
          width="220">
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="150">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small"><i class="el-icon-download"></i></el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    handleClick(row) {
      console.log(row);
    }
  },

  data() {
    return {
      tableData: [{
        date: '2016-05-02',
        file_name: 'file1',
        state: '未下载',
        id: '01'
      }, {
        date: '2016-05-04',
        file_name: 'file2',
        state: '未下载',
        id: '02'
      }]
    }
  }
}
</script>
